package evo.engine
{
	import mx.effects.Sequence;
	
	public class AbstractPart implements IDemoPart
	{	
		protected var engine:DemoEngine;
		private var sync:Sequencer;
		
		public function AbstractPart(sync:Sequencer)
		{
			this.sync = sync;
		}
		
		public function prePlay(dt:Number):void
		{
		}
		
		public function postPlay(dt:Number):void
		{
		}
		
		public function preInit(engine:DemoEngine):void
		{
			this.engine = engine;
		}
		
		public function init(engine:DemoEngine):void
		{
			sync.phase.addListener(on_phase);
			
		}

		protected function on_phase(t:uint):void
		{
			trace("Phase");
			sync.phase.removeListener(on_phase);
			cleanup();
		}
		
		protected function cleanup():void
		{
			
		}
	}
}